<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.0.0">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/logo_32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/logo_16.png">

<link rel="stylesheet" href="/blog/css/main.css">

<link rel="stylesheet" href="//fonts.lug.ustc.edu.cn/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"shimmernight.gitee.io","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="hexo模板快速搭建博客">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo+gitee搭建博客">
<meta property="og:url" content="https://shimmernight.gitee.io/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="Shimmer&#39;s Blog">
<meta property="og:description" content="hexo模板快速搭建博客">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161216262-993916819.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161343110-1070102071.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161359550-1764101506.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161410570-42081424.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161241462-2086530710.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161252195-1328699544.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161303910-1097377280.png">
<meta property="og:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161318355-1195792976.png">
<meta property="article:published_time" content="2020-08-02T23:54:05.000Z">
<meta property="article:modified_time" content="2020-08-03T07:19:05.713Z">
<meta property="article:author" content="shimmer">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://shimmernight.gitee.io/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161216262-993916819.png">

<link rel="canonical" href="https://shimmernight.gitee.io/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>hexo+gitee搭建博客 | Shimmer's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">

  <div class="container use-motion">
    <!-- 顶部黑线 -->
    <!-- <div class="headband"></div> -->

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Shimmer's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">记录生活中的点点滴滴</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/blog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/blog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">3</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">1</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">3</span></a>

  </li>
        <li class="menu-item menu-item-schedule">

    <a href="/blog/schedule/" rel="section"><i class="fa fa-calendar fa-fw"></i>日程表</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/shimmernight" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://shimmernight.gitee.io/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/mylogo.jpg">
      <meta itemprop="name" content="shimmer">
      <meta itemprop="description" content="欢迎您的到来！">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Shimmer's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          hexo+gitee搭建博客
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-08-03 07:54:05 / 修改时间：15:19:05" itemprop="dateCreated datePublished" datetime="2020-08-03T07:54:05+08:00">2020-08-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" itemprop="url" rel="index"><span itemprop="name">博客搭建</span></a>
                </span>
            </span>

          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>2 分钟</span>
            </span>
            <div class="post-description">hexo模板快速搭建博客</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <hr>
<p>hexo模板快速搭建博客</p>
<a id="more"></a>

<p>参考链接：<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html">https://www.cnblogs.com/somata/p/11255547.html</a></p>
<p>首先准备软件：</p>
<ul>
<li>git (提供命令git) <a target="_blank" rel="noopener" href="https://git-scm.com/">git官网</a></li>
<li>notepad++(方便编辑)<a target="_blank" rel="noopener" href="https://notepad-plus-plus.org/">notepad++官网</a></li>
<li>nodejs(hexo依赖)<a target="_blank" rel="noopener" href="https://nodejs.org/en/">nodejs官网</a></li>
<li>7z(压缩包)<a target="_blank" rel="noopener" href="https://www.7-zip.org/">7z官网</a></li>
</ul>
<p>链接：<a target="_blank" rel="noopener" href="https://pan.baidu.com/s/1OWnJMV1kI86aLUZZEkt6Yw">https://pan.baidu.com/s/1OWnJMV1kI86aLUZZEkt6Yw</a> 提取码：im6o 这里整合好了。</p>
<p>还有<a target="_blank" rel="noopener" href="https://gitee.com/">码云主页</a></p>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装#"></a>安装<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html#691516839">#</a></h2><p>nodejs、git、notepad++和7z的安装过程省略。主要要说的是hexo的安装和配置。<br>再以上几个安装好后，注意测试是否可以再命令行可以使用：<code>git</code>,<code>npm</code><br>这里虽然使用的是Windows值作但是全部都是使用命令完成，与Linux的命令相同，所以可以Linux也是可以完成的。<br>Win+R-&gt; ‘cmd’ 打开命令行<br>首先需要配置npm的国内源</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Copynpm config <span class="built_in">set</span> registry https://registry.npm.taobao.org        <span class="comment">#配置国内的镜像源</span></span><br><span class="line">npm info hexo    <span class="comment"># 测试查看hexo的安装信息，是否是taobao.org的源</span></span><br></pre></td></tr></table></figure>

<p>然后再是安装hexo：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Copynpm install -g hexo         <span class="comment"># 通过npm安装hexo</span></span><br><span class="line"><span class="comment"># -g 指定全局安装，可以使用hexo命令</span></span><br></pre></td></tr></table></figure>

<p>我这里再切换到桌面路径进行操作</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Copyhexo init <span class="built_in">test</span>        <span class="comment"># 初始化创建，会再桌面创建test文件夹</span></span><br><span class="line"><span class="built_in">cd</span> <span class="built_in">test</span>                <span class="comment"># 进入test目录</span></span><br><span class="line">npm install            <span class="comment"># 进一步安装hexo所需文件</span></span><br></pre></td></tr></table></figure>

<p>这样hexo就安装完成了，接下来就可以启动<code>hexo</code>了</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Copyhexo clean            <span class="comment"># 清除所有记录</span></span><br><span class="line">hexo generate        <span class="comment"># 生成静态网页</span></span><br><span class="line">hexo server -p 80    <span class="comment"># 启动服务</span></span><br></pre></td></tr></table></figure>

<p>然后使用浏览器访问<code>http://server_ip</code><br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161216262-993916819.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161216262-993916819.png" alt="img"></a></p>
<h2 id="主题配置"><a href="#主题配置" class="headerlink" title="主题配置#"></a>主题配置<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html#1122429411">#</a></h2><p>如果不喜欢这个主题可以换一个<br>比如next主题，<a target="_blank" rel="noopener" href="http://theme-next.iissnan.com/">next官网</a> <a target="_blank" rel="noopener" href="https://github.com/iissnan/hexo-theme-next/">next的github网页</a>，去github下载压缩包然后放到test下的themes目录下。</p>
<p>然后配置<code>_config.yml</code></p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">Copy……</span></span><br><span class="line"><span class="attr">theme:</span> <span class="string">hexo-theme-next-5.1.4</span>        <span class="comment"># 这里需要注意:后面要有一个空格，名称要和theme下的主题目录名称相同。</span></span><br><span class="line"><span class="string">……</span></span><br></pre></td></tr></table></figure>

<p>hexo的其他配置参考<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">hexo官方文档</a><br>next的配置参考<a target="_blank" rel="noopener" href="http://theme-next.iissnan.com/getting-started.html">next官方文档</a></p>
<p>然后重启hexo服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Copyhexo clean            <span class="comment"># 清除所有记录</span></span><br><span class="line">hexo generate        <span class="comment"># 生成静态网页</span></span><br><span class="line">hexo server -p 80    <span class="comment"># 启动服务</span></span><br></pre></td></tr></table></figure>

<p>然后重新访问网页，就会发生变化<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161343110-1070102071.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161343110-1070102071.png" alt="img"></a></p>
<h2 id="生成blog"><a href="#生成blog" class="headerlink" title="生成blog#"></a>生成blog<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html#196179839">#</a></h2><p>生成blog：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Copyhexo new <span class="built_in">test</span>        <span class="comment"># 生成主页,在test/source/_posts下会生成test.md文件</span></span><br></pre></td></tr></table></figure>

<p>所有网页都时通过md文件来显示的，如果想要学习md-&gt;markdown语法,可以参考<a target="_blank" rel="noopener" href="https://daringfireball.net/projects/markdown/syntax">原作者markdown解释</a></p>
<h2 id="上传到gitee"><a href="#上传到gitee" class="headerlink" title="上传到gitee#"></a>上传到gitee<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html#3979186578">#</a></h2><p><a target="_blank" rel="noopener" href="https://gitee.com/">gitee主页</a><br>再gitee创建自己的账户，然后再创建一个自己仓库<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161359550-1764101506.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161359550-1764101506.png" alt="img"></a><br>在创建仓库完成后进入到仓库<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161410570-42081424.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161410570-42081424.png" alt="img"></a><br>复制URL，到hexo的配置文件<code>_config.yml</code></p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">Copy……</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span>                    <span class="comment"># type为git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">https://gitee.com/somata/somata</span>    <span class="comment"># 仓库的URL</span></span><br><span class="line"><span class="string">……</span></span><br></pre></td></tr></table></figure>

<p>这里先安装一个hexo的插件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Copynpm install hexo-deployer-git --save    <span class="comment"># 安装git插件</span></span><br><span class="line">git config --global user.email *********@qq.com    <span class="comment"># 设置gitee邮箱（gitee的注册邮箱）</span></span><br><span class="line">git config --global user.name <span class="string">&#x27;****&#x27;</span>            <span class="comment"># 设置用户名（git的注册昵称）</span></span><br><span class="line">hexo deploy    <span class="comment"># 上传到gitee</span></span><br><span class="line"><span class="comment"># 在上传时，需要再次输入gitee的注册邮箱作为username，账户密码作为password</span></span><br></pre></td></tr></table></figure>

<p>上传完成之后，仓库就会多出以下文件<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161241462-2086530710.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161241462-2086530710.png" alt="img"></a><br>然后哦选择gitee pages 网页解析服务<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161252195-1328699544.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161252195-1328699544.png" alt="img"></a><br>然后选择开启 或 更新即可。注意需要绑定手机号，否则不允许使用pages服务。然后访问网址<br>这里需要注意，每次重新上传网页后，都需要到这里来更新网页<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161303910-1097377280.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161303910-1097377280.png" alt="img"></a></p>
<h2 id="解决hexo博客网页无法使用图片问题"><a href="#解决hexo博客网页无法使用图片问题" class="headerlink" title="解决hexo博客网页无法使用图片问题#"></a>解决hexo博客网页无法使用图片问题<a target="_blank" rel="noopener" href="https://www.cnblogs.com/somata/p/11255547.html#1239637887">#</a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">Copynpm install hexo-asset-image --save    <span class="comment"># 安装hexo插件</span></span><br><span class="line">Copy<span class="comment"># 这里还要注意修改_config.yml中的一个点</span></span><br><span class="line">……</span><br><span class="line">post_asset_folder: <span class="literal">true</span></span><br><span class="line">……</span><br><span class="line">Copyhexo new <span class="built_in">test</span>        <span class="comment"># 生成新的网页</span></span><br></pre></td></tr></table></figure>

<p>位置在 test/source/_posts下，会同时生成test目录和test.md 网页，将需要的图片放置到test目录下，test.md就可以正常解析了，注意：要在图片路径直接写成同目录下即可。<br><a target="_blank" rel="noopener" href="https://img2018.cnblogs.com/blog/1641240/201907/1641240-20190727161318355-1195792976.png"><img src="/blog/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/1641240-20190727161318355-1195792976.png" alt="img"></a></p>

    </div>

    
    
    

    <!--文章结束标语-->
    
    <div style="text-align:center;color: #ccc;font-size:14px;">
------------- 本文结束 <i class="fa fa-heart-o"></i> 感谢您的阅读-------------
</div>

    
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">

  </div>
</div>

        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>shimmer
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://shimmernight.gitee.io/2020/08/03/hexo-gitee%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/" title="hexo+gitee搭建博客">https://shimmernight.gitee.io/2020/08/03/hexo-gitee搭建博客/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/blog/tags/hexo/" rel="tag"****><i class="fa fa-tag"></i> hexo</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/blog/2020/08/03/GUI/" rel="next" title="GUI">
      GUI <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85"><span class="nav-number">1.</span> <span class="nav-text">安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="nav-number">2.</span> <span class="nav-text">主题配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%94%9F%E6%88%90blog"><span class="nav-number">3.</span> <span class="nav-text">生成blog</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%8A%E4%BC%A0%E5%88%B0gitee"><span class="nav-number">4.</span> <span class="nav-text">上传到gitee</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A7%A3%E5%86%B3hexo%E5%8D%9A%E5%AE%A2%E7%BD%91%E9%A1%B5%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%E5%9B%BE%E7%89%87%E9%97%AE%E9%A2%98"><span class="nav-number">5.</span> <span class="nav-text">解决hexo博客网页无法使用图片问题</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="shimmer"
      src="/blog/images/mylogo.jpg">
  <p class="site-author-name" itemprop="name">shimmer</p>
  <div class="site-description" itemprop="description">欢迎您的到来！</div>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/shimmernight" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;shimmernight" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_44092288" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_44092288" rel="noopener" target="_blank"><i class="fa fa-book fa-fw"></i>CSDN</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://im.qq.com/" title="QQ → https:&#x2F;&#x2F;im.qq.com&#x2F;" rel="noopener" target="_blank"><i class="fab fa-qq fa-fw"></i>QQ</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://qianfanguojin.github.io/" title="shimmer → https:&#x2F;&#x2F;qianfanguojin.github.io&#x2F;" rel="noopener" target="_blank"><i class="fab fa-codepen fa-fw"></i>shimmer</a>
      </span>
  </div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/blog/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>




        <!--网易云链接-->
        <iframe frameborder="no" border="0" 
        marginwidth="0" marginheight="0" width=298 height=52 
        src="//music.163.com/outchain/player?type=2&id=480353&auto=0&height=32"></iframe>
          
          <!-- 标签云
        
        <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
        <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
        <div class="widget-wrap">
            <div id="myCanvasContainer" class="widget tagcloud">
                <canvas width="250" height="250" id="resCanvas" style="width=100%">
                    <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/GUI/" rel="tag">GUI</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/hexo/" rel="tag">hexo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" rel="tag">网络编程</a><span class="tag-list-count">1</span></li></ul>
                </canvas>
            </div>
        </div>
       -->
     
      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">shimmer</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">21k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">19 分钟</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,0' opacity='0.5' zIndex='-1' count='150' src="/blog/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  




  
<script src="/blog/js/local-search.js"></script>













  

  


<!-- 页面点击小红心 -->


<script src="/blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/blog/live2dw/assets/tororo.model.json"},"display":{"position":"right","width":200,"height":300},"mobile":{"show":true},"log":false});</script></body>
</html>
